package cn.edu.zut.hhr.controller;

import cn.edu.zut.hhr.vo.RestResponse;
import entity.EventTracking;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import service.EventTrackingTemplate;

import javax.annotation.Resource;

@Controller
public class EventTrackingController {
    @Resource
    private EventTrackingTemplate eventTrackTemplate;
    @PostMapping("/eventTracking")
    //埋点丢就丢了无所谓, 采用发后既忘的发送方式, 该方法异步调用既可以.
    public RestResponse eventTracking(@RequestBody EventTracking params){
        eventTrackTemplate.send(params);
        return RestResponse.success("success");
    }
}
